package com.free.wang.demo02.controller;

import com.free.wang.demo02.entity.Score;
import com.free.wang.demo02.entity.Student;
import com.free.wang.demo02.service.ScoreService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author admin
 * @Description 学生接口层
 * @date 2020-07-05 15:19:00
 */
@Slf4j
@RestController
@RequestMapping(value = "/api/score")
public class ScoreController {

    @Autowired
    private ScoreService scoreService;

    @PostMapping(value = "/create")
    public String create(@RequestBody Score score) {
        this.scoreService.insertSelective(score);
        return "SUCCESS";
    }

    @GetMapping(value = "/delete")
    public String delete(String paramOne, String paramTwo) {
        this.scoreService.deleteByPrimaryKey(paramOne, paramTwo);
        return "SUCCESS";
    }

    @PostMapping(value = "/update")
    public String update(@RequestBody Score score) {
        this.scoreService.updateByPrimaryKeySelective(score);
        return "SUCCESS";
    }

    @GetMapping(value = "/page")
    public String page(String paramOne, String paramTwo) {
        this.scoreService.selectByPrimaryKey(paramOne, paramTwo);
        return "SUCCESS";
    }

}
